package com.syqc.monitor.ui.cost

import androidx.lifecycle.MutableLiveData
import com.syqc.comlib.auto.AutoDisposeViewModel
import com.syqc.comlib.utils.AppContext
import com.syqc.entity.KeyValue
import com.syqc.monitor.R

class CarFeeViewModel : AutoDisposeViewModel() {
    var index = 0

    var carId = ""
        set(value) {
            field = value
            carIdLive.postValue(field)
        }

    val carIdLive = MutableLiveData<String>()
    val clearLive = MutableLiveData<Boolean>()
    private val feeTypes = mutableListOf<KeyValue>()

    init {
        initTypes()
    }

    /**
     * 初始化费用类型
     */
    private fun initTypes() {
        feeTypes.add(KeyValue("0", AppContext.getDescById(R.string.desc_fee_repair)))
        feeTypes.add(KeyValue("1", AppContext.getDescById(R.string.desc_fee_traffic)))
        feeTypes.add(KeyValue("2", AppContext.getDescById(R.string.desc_fee_add_oil)))
        feeTypes.add(KeyValue("3", AppContext.getDescById(R.string.desc_fee_insure)))
        feeTypes.add(KeyValue("4", AppContext.getDescById(R.string.desc_fee_year)))
        feeTypes.add(KeyValue("5", AppContext.getDescById(R.string.desc_fee_other)))
    }

    fun getFeeTypes() = feeTypes


}